package com.report.dto.response.zu;




import cn.zhxu.bs.bean.DbField;
import cn.zhxu.bs.bean.DbIgnore;
import cn.zhxu.bs.bean.SearchBean;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author summer
 * @version 1.0
 * @date 2024/7/25 20:55
 */
@Data
@SearchBean(tables = "research_report r " +
        " LEFT JOIN  research_tag t ON r.type_id=t.id LEFT JOIN research_tag t1 ON r.security_id=t1.id   " +
        " LEFT JOIN  research_tag t3 ON t3.id=r.recentId LEFT JOIN research_tag t2 ON t2.id=r.industry_id " +
        " Left JOIN research_file f ON r.file_id=f.id ",autoMapTo = "r")
public class ReportItemRes implements Serializable {

    @DbField("r.id")
    private Integer id;


    @DbField("r.name")
    private String name;

    @DbField("f.name")
    private String fileName;

    @DbField("r.file_id")
    private Integer fileId;

    @DbField("f.image")
    private String image;

    @DbField("r.context")
    private String context;

    /**
     * 是否热点
     */
    @DbField("r.type_id")
    private Integer typeId;

    @DbField("t.name")
    private String typeName;


    /**
     * 研报行业
     */
    @DbField("t2.name")
    private String industryName;

    @DbField("r.security_id")
    private Integer securityId;

    @DbField("r.industry_id")
    private Integer industryId;

    @DbField("t1.name")
    private String securityName;

    @DbField("r.createTime")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private LocalDateTime createTime;

    @DbField("r.auth")
    private String auth;

    @DbField("r.deleted")
    private Integer deleted;

    /*
 热门榜单
  */
    @DbField("r.ranking")
    private Integer ranking;

    @DbField("(CASE WHEN r.ranking=1 THEN '是' ELSE '否' END )")
    private String rankingName;



    /**
     * 今日推荐
     */
    @DbField("r.todaySell")
    private Integer todaySell;

    @DbField("(CASE WHEN r.todaySell=1 THEN '是' ELSE '否' END )")
    private String todaySellName;

    /**
     * 研报类型
     */
    @DbField("r.recentId")
    private Integer recentId;
    /**
     *
     */
    @DbField("t3.name")
    private String recentName;




    @DbField("f.url")
    private String path;

    @DbField("f.pages")
    private Integer pages;

    //是否商
    @DbField("r.security")
    private Integer security;

    @DbField("r.deep")
    private Integer deep;

    @DbField("r.language")
    private Integer language;


    @DbIgnore
    private Long collectNum;

    @DbField("r.browse_num")
    private Integer browseNum;
}
